﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using IndignadoFramework.BackBone.Model;

namespace IndignadoFramework.PhoneServices
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]
    public interface IPhoneServices
    {
        [OperationContract]
        List<ConvocatoriaPhone> ListarConvocatorias(String userId);

        [OperationContract]
        void AsistirConvocatoria(Nullable<long> facebookID, ConvocatoriaPhone convocatoria);
    }


    // Use a data contract as illustrated in the sample below to add composite types to service operations.
    [DataContract]
    public class ConvocatoriaPhone
    {
        [DataMember(IsRequired = true)]
        public int Id;
        [DataMember(IsRequired = true)]
        public string ConvocatoriaTitulo;
        [DataMember(IsRequired = true)]
        public System.DateTime ConvocatoriaFechaInicio;
        [DataMember(IsRequired = true)]
        public System.DateTime ConvocatoriaFechaFin;
        [DataMember(IsRequired = true)]
        public string ConvocatoriaDetalle;
        [DataMember(IsRequired = true)]
        public string ConvocatoriaUbicacionX;
        [DataMember(IsRequired = true)]
        public string ConvocatoriaUbicacionY;

        public ConvocatoriaPhone() { }

        public ConvocatoriaPhone (int id, string titulo, System.DateTime inicio, System.DateTime fin,
                                    string detalle, string coordX, string coordY)
        {
            Id = id;
            ConvocatoriaTitulo = titulo;
            ConvocatoriaFechaInicio = inicio;
            ConvocatoriaFechaFin = fin;
            ConvocatoriaDetalle = detalle;
            ConvocatoriaUbicacionX = coordX;
            ConvocatoriaUbicacionY = coordY;
        }
    }
}
